vcContainer

vcContainer is a base class for all behaviors that can contain components, for example buffers, stackers and conveyors.

See in: Overview

Module: vcBehaviors

Parent: vcFlow

Children: vcComponentContainer, vcComponentCreator, vcMotionPath, vcRoutingRule, vcInterpolatingTransportController

Referenced by: vcBufferProductsStatement.DestinationContainer, vcCreateProductStatement.Container, vcGetProductsStatement.Container, vcRaycastSensor.DetectionContainer, ... (see more)
vcBufferProductsStatement.DestinationContainer
vcCreateProductStatement.Container
vcGetProductsStatement.Container
vcRaycastSensor.DetectionContainer
vcSimProcessorField.Path
vcTransportNode.ComponentContainer
vcTransportOutStatementBase.Container
vcVolumeSensor.DetectionContainer

Properties

Learn how to use properties here. The properties are also inherited from the parent class.

NameTypeAccessDescription
CapacityIntegerRWGets or sets the maximum number of components that can be stored in the container at any given time. That is, the logical capacity of the container.
CapacityBlocksList[vcBehaviors.vcCapacityController]RWGets or sets a list of Capacity Controller type behaviors that globally control the capacity of the container.
This property overrides the container's Capacity.
ComponentCountIntegerRGets the amount of components stored in the container.
Componentslist[vcComponent]RGets a list of components stored in the container.
ContentVisibleBooleanRWGets or sets the visibility of components stored in the container.
TransitionSignalvcBooleanSignalRWGets or sets the signal used for signaling when a component enters/exits the container.

Methods

Learn how to use methods here. The methods are also inherited from the parent class.

NameReturn TypeParametersDescription
getContainerProximityRealvcVector positionReturns the orthogonal distance from a given position to the container.
See more
Note: If the container is static, this method may return a very large value for any position.

Parameters:
position (vcVector): Position to calculate distance from.

Returns:
Real: Distance from the position vector to the path.
getPathPositionvcMatrixReal pathDistanceReturns a position matrix for a point on the path at a given distance.
See more
The position matrix is based in the node coordinate system of the container.

Parameters:
pathDistance (float): Distance from the point on path.

Returns:
vcMatrix: Position matrix.
grabNonevcComponent component,
Optional Keyword[assemblyMode = vcNodeAssemblyGrabMode]
Attaches a given component to this container.
If the container is static, the component will automatically retain its location.
See more
If the Assembly feature is used in Process Modeling, the optional assemblyMode argument defines how the Assembly Instance is handled when grabbing the product. See vcNodeAssemblyGrabMode enum for more information.

Parameters:
component (vcComponent): Component to attach.
assemblyMode (vcNodeAssemblyGrabMode): How to attach given component. Defaults to KEEP.

Exceptions:
RuntimeError: When container is not owned by any node.
RuntimeError: When given component is the same as the component that owns/contains this vcContainer.

Events

Learn how to use events here. The events are also inherited from the parent class.

NameParametersDescription
OnTransitionvcComponent component,
bool arriveLeave
Triggered when a component is transferred to or from the container.
If the OnTransition() event is triggered with an arrive_leave value True, the component has just been added and is in a well-defined state with respect to its container. It is then safe to manipulate the component.
See more
If arrive_leave value is False, the component is in the process of being removed and its Container is not well-defined. In this case, DO NOT use the Container property of the component being transferred.

Parameters:
component (vcComponent): The component in question.
arriveLeave (bool): True if the component has arrived to the container or False if the component has departed.

Example: Wait Until Product Arrived to Container

""" This example shows how to wait for a product to arrive in a container. """

import vcCore as vc


def filter_arriving(product, is_arriving):
  return is_arriving

async def OnRun():
  global product_arrived
  comp = vc.getComponent()
  cont = comp.findBehavior("ComponentContainer")
  
  while True:
    product_arrived = False
    await cont.OnTransition.wait(filter_arriving)
    print ("Product arrived")
    vc.delay(1)